#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	int count = 0;
	while (n != 1)
	{
		if (n % 2 == 0)
		{
			n /= 2;
			count++;
		}
		else
		{
			n = n * 3 + 1;
			count++;
		}
	}
	printf("%d", count);
	return 0;
}

int main()
{
	int a = 0;
	int b = 0;
	int c = 0;

	scanf("%d", &a);

	for (; a != 0;)
	{
		b = a % 10;
		a /= 10;
		c += b;
	}

	printf("%d\n", c);
	return 0;
}

#include <stdio.h>
int main()
{
	int n = 0;
	scanf("%d", &n);
	int i = 0;
	int count = 0;
	int num = 0;
	for (i = 1; i <= n; i++)
	{
		count += i;
		num += count;
	}
	printf("%d", num);
	return 0;
}